home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
pascal
/
tegl6b.zip
/
INTROPAK.EXE
/
lha
/
FASTGRPH.DOC
< prev
next >
Wrap
Text File
|
1991-08-16
|
8KB
|
235 lines
{-----------------------------------------------------------------------------}
{ TEGL Windows ToolKit II }
{ Copyright (C) 1990, 1991 TEGL Systems Corporation }
{ All Rights Reserved. }
{-----------------------------------------------------------------------------}
{$I switches.inc}
unit FastGrph;
INTERFACE
uses dos,teglfont;
TYPE
{-- typedefs for core graphics routines }
TEGLGRFunc00 = Function:Pointer;
TEGLGRFunc01 = Function(x,y:Word):Word;
TEGLGRFunc02 = Function(x,y:Word; buffer:Pointer):Word;
TEGLGRFunc03 = Function(x,y,x1,y1:Word):longint;
TEGLGRFunc04 = Function(mode:integer):integer;
TEGLGRFunc05 = Function(x,y,borderc:word; scan:integer):Word;
TEGLGRProc00 = Procedure(vtab:Pointer);
TEGLGRProc01 = Procedure(x,y,x1,y2,n:Word);
TEGLGRProc02 = Procedure(x,y,n:Word);
TEGLGRProc03 = Procedure(x,y:Word;buf:pointer;n:Word);
TEGLGRProc04 = Procedure(x,y,x1,y1:Word;buffer:pointer);
TEGLGRProc05 = Procedure(x,y,x1,y1:Word;buff1,buff2:Pointer);
TEGLGRProc06 = Procedure(x,y:Word;buff1,buff2:Pointer);
TEGLGRProc07 = Procedure(c,x,y,Color,bkcolor:Word);
TEGLGRProc08 = Procedure;
TEGLGRProc09 = Procedure(x,y:Word);
TEGLGRProc10 = Procedure(sx,sy,sx1,sy1,tx,ty:Word; vertlines,horzlines:integer; spage,tpage:pointer);
TEGLGRProc11 = Procedure(pagen:word);
{-- mouse mask }
MaskPtr = ^MaskType;
MaskType = Array[0..1, 0..15] of Word;
VideoInfoPtr = ^VideoInfoRec;
VideoInfoRec = RECORD
ModeName : string[21]; {Mode String Name}
ModeNumber : Integer; {Mode Number}
Maxx : Word; {Device Full Resolution in X}
Maxy : Word; {Device Full Resolution in Y}
StdChrWidth : Word; {Standard char size X}
StdChrHeight : Word; {Standard char size Y}
MaxColor : Word; {Number of colors}
MaxPages : Word; {Number of pages}
MaxPalette : Word; {Number of palettes}
ActivePage : Word; {buffer offset for 2 page}
ScreenSeg : Word; {Screen Segment}
BytesPerLine : Word; {bytes per line}
aspectx : Word; {aspect ratio x * 1000}
aspecty : Word; {aspect ratio y * 1000}
DriverAddr : pointer; {video driver start address}
DriverNamePtr : pointer; {video driver name pointer}
DriverJumpTable : pointer; {video driver Jump Table}
GraphBufferPtr : pointer; {Graphic Work Buffer}
GraphBufferSize : Word; {Graphic Size Buffer}
RmwBits : Word; {Read/Write modes}
transparency : byte; {transpanrancy on-$00/off-$ff}
Jagged : boolean; {jagged characters on-$01/off-$00}
FontTable : Pointer; {pointer to font table}
EGApaletteflag : boolean; {allow EGA pallete set}
RGBpaletteflag : boolean; {allow VGA pallete set}
proportionalfont : Boolean; {proportional font switch}
TeglFillMask : Word; {fillmask for lines}
wminx : word; {viewport - minx}
wminy : word; {viewport - miny}
wmaxx : word; {viewport - maxx}
wmaxy : word; {viewport - maxy}
clipped : boolean; {viewport - clipping on/off}
MouseColor : Word; {Mouse color}
MouseHotSpot_XOFS : Word; {Mouse hotspot}
MouseHotSpot_YOFS : Word; {Mouse hotspot}
MouseMask : MaskPtr; {Mouse Cursor Mask}
Nextmodeptr : videoinfoptr; {Next VideoMode}
END;
DriverFilePtr = ^DriverFileTable;
DriverFileTable = Record
NextDrvFile : DriverFilePtr;
ModeName : string[20];
FileName : string[80];
end;
BGIGdGmPtr = ^BGIGdGmRec;
BGIGdGmRec = Record
NextBGIPtr : BGIGDGMPtr;
ModeName : string[20];
GD : integer;
GM : integer;
end;
BGITGIDrv = ^BGITGIRec;
BGITGIRec = Record
NextBGITGI : BGITGIDrv;
TGIDriver : string[15];
Graphdriver : integer;
end;
fontptr = ^fontinfo;
fontinfo = Record
Fontsignature : word;
FontHeight : byte;
FontWidth : byte;
FontAsciiStart : byte;
FontAsciiEnd : byte;
FontTop : byte;
FontBase : byte;
FontBottom : byte;
FontByteWidth : byte;
end;
const
{$ifdef NoGr}
lastmode__ : byte = $ff;
lastpage__ : byte = $ff;
{$endif}
GraphBufferSize : word = 8192;
GraphBufferInit : boolean = false;
GraphScanBuffer : pointer = NIL;
DrvFileTable : DriverFilePtr = NIL;
DrvInfoTable : VideoInfoPtr = NIL;
DrvBGITable : BGIGDGMPtr = NIL;
DrvTGITable : BGITGIDrv = NIL;
ActiveTEGLMode : VideoInfoPtr = NIL;
UnderlineCharStatus : boolean = false;
LastAssignedGD : word = 10;
{ BIOS_Data = $40; }
{ Constants for GetBiti and PutBiti }
FGNorm = 0;
FGAnd = $08;
FGOr = $10;
FGXor = $18;
FGNot = $80;
{ GraphResult error return codes: }
grOk = 0;
grNoInitGraph = -1;
grNotDetected = -2;
grFileNotFound = -3;
grInvalidDriver = -4;
grNoLoadMem = -5;
grNoScanMem = -6;
grNoFloodMem = -7;
grFontNotFound = -8;
grNoFontMem = -9;
grInvalidMode = -10;
grError = -11; { generic error }
grIOerror = -12;
grInvalidFont = -13;
grInvalidFontNum = -14;
VAR
{-- Procedureal pointers. Initialized to point at the correct }
{-- graphics driver routines }
GetVideoTable : TEGLGRFunc00;
Getpixs : TEGLGRFunc01;
Extractpixs : TEGLGRFunc02;
BigImageSize : TEGLGRFunc03;
InitVideoMode : TEGLGRFunc04;
Scanborder : TEGLGRFunc05;
SetVideoTable : TEGLGRProc00;
SetXLATTable : TEGLGRProc00;
FastLine : TEGLGRProc01;
Putpixs : TEGLGRProc02;
Putbiti : TEGLGRProc03;
GetBitI : TEGLGRProc04;
ExtractIMG : TEGLGRProc05;
OverlayIMG : TEGLGRProc06;
TEGLWrtChar : TEGLGRProc07;
MCursorOff : TEGLGRProc08;
MCursorOn : TEGLGRProc09;
MSetPos : TEGLGRProc09;
MoveVideoPixels : TEGLGRProc10;
SetTEGLVPage : TEGLGRProc11;
SetTEGLAPage : TEGLGRProc11;
procedure settransparency(onoff:boolean);
function RegisterTGIDriver(Driver:pointer):integer;
Procedure PictSize (VAR w,h:Word; buf:Pointer);
Procedure Putpict (x,y:Word; buf:Pointer;n:Word);
Function TEGLTextWidth(mystr : String) : Integer;
Function TEGLCharBase : integer;
Function TEGLCharTop : integer;
Function TEGLCharStart : integer;
Function TEGLCharBottom : integer;
Function TEGLCharRange : integer;
Function TEGLCharWidth(c : Word) : Word;
Function TEGLCharMaxWidth : integer;
Function TEGLCharHeight : Word;
Procedure SetTEGLFont(p : Pointer);
Function GetTEGLFont : Pointer;
Procedure SetProportional(onoff:Boolean);
function GetProportional : boolean;
Procedure OutTGTextXY(x,y,color,bkcolor : Integer; mystr : String);
Procedure SwapBytes(buff1,buff2:Pointer; bytestoswap:longint);
Procedure XORCornerBox (x,y,x1,y1,Color : Integer);
Procedure XORBox (x1,y1,x2,y2,Color : Integer);
procedure FastRect(x1, y1, x2, y2, c : integer);
procedure FastBar(x1,y1,x2,y2,c : integer);
function SetGraphicMode(var ModeName:string; pathtodriver:string) : integer;
procedure AddDriverFileName(FileName:string; ModeName:string);
function FindBGIToModeName(GD,GM : integer) : BGIGDGMPtr;
function FindModeNameToBGI(ModeName:string) : BGIGDGMPtr;
procedure AddDriverBGIModes(ModeName:string; gd,gm:integer);
function FindTGIGraphDriver(TEGLDriverName:string) : BGITGIDrv;
procedure AddTGIGraphDriver(TEGLDriverName:string; gd:integer);
procedure AllocateScanBuffer(BufSize : word);
procedure FastScrollDown(x1,y1,x2,y2,pixlines:integer);
procedure FastScrollUp(x1,y1,x2,y2,pixlines:integer);
procedure FastScrollRight(x1,y1,x2,y2,pixlines:integer);
procedure FastScrollLeft(x1,y1,x2,y2,pixlines:integer);
function GetRMWBits:word;
Procedure SetRMWBits(rmw